<template>
    <div class="header">
        <div class="header-left">
            <span class="iconfont back-icon icon-fanhui"></span>
        </div>
        <div class="header-input">
            <span class="iconfont icon-sousuo"></span>
            输入景点游玩地点
        </div>
        <router-link to="/city">
        <div class="header-right">
        {{this.city}}<span class="iconfont arrow-icon icon-jiantou"></span>
        </div>
        </router-link>
    </div>
</template>

<script>

import {mapState} from 'vuex'

export default {
  name:'home',
  mounted() {
    console.log(this.city)
  },
  computed:{
      ...mapState(['city']) //把vuex city公共数据映射到city
  }
}
</script>

<style lang="stylus" scoped> 

 @import "~styles/varibles.styl"
 .header
    display flex
    height  0.86rem
    line-height  0.86rem
    background $bgcolor
    .header-left
        width .64rem
        float left
        .back-icon
            text-align center
            color #fff
            font-size .4rem
            padding-left .07rem
    .header-input
        flex 1
        background #fff
        margin-top .12rem
        height .64rem
        line-height .64rem
        padding-left .2rem
        color #ccc
        border-radius .06rem
        margin-left .12rem
    .header-right
        min-width 1.04rem
        padding 0 0.1rem
        float right
        color #fff
        text-align center
        .arrow-icon
            font-size .24rem
          
    </style>

